import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";

import {
  Button,
  Message,
  Empty,
  Tooltip,
  Image,
  Divider,
  Popover,
  Switch,
  Select,
  Option,
} from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
import VueLazyload from "vue-lazyload";
import mavonEditor from 'mavon-editor';
import 'mavon-editor/dist/css/index.css';
import historyRegistry from './components/common/drawer/main'
import loadingRegistry from './components/common/loading/main'


Vue.config.productionTip = false;
Vue.use(Button);
Message.install = function(Vue, options) {
  Vue.prototype.$message = Message;
};
Vue.use(Message);
Vue.use(Empty);
Vue.use(Tooltip);
Vue.use(Image);
Vue.use(Divider);
Vue.use(Popover);
Vue.use(Switch);
Vue.use(Select);
Vue.use(Option);
Vue.use(mavonEditor);
Vue.prototype.$store = store;
Vue.use(historyRegistry);
Vue.use(loadingRegistry);

Vue.use(VueLazyload, {
  preLoad: 1,
  loading: require("@/assets/img/icon/loading.svg"), //加载中图片，一定要有，不然会一直重复加载占位图
  error: require("@/assets/img/icon/error.svg"), //加载失败图片
  attempt: 1,
});




new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");
